<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:c="http://www.w3.org/1999/XSL/Transform">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>


    <!-- Meta -->
    <meta name="description" content="Premium Quality and Responsive UI for Dashboard."/>
    <meta name="author" content="ThemePixels"/>

    <link rel="shortcut icon" th:href="@{/picture/favicon.ico}" type="image/x-icon"/>
    <title>旅游管理系统</title>

    <!-- vendor css -->
    <link th:href="@{/admin/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/admin/css/ionicons.css}" rel="stylesheet"/>
    <link th:href="@{/admin/css/perfect-scrollbar.css}" rel="stylesheet"/>
    <link th:href="@{/admin/css/github.css}" rel="stylesheet"/>
    <link th:href="@{/admin/css/jquery.datatables.css}" rel="stylesheet"/>
    <link th:href="@{/admin/css/select2.min.css}" rel="stylesheet"/>

    <!-- Starlight CSS -->
    <link rel="stylesheet" th:href="@{/admin/css/starlight.css}"/>
</head>

<body>

<!-- ########## START: LEFT PANEL ########## -->
<div class="sl-logo"><a href=""><img th:src="@{/admin/picture/mt_logo_wh.jpg}" style="width: 30px; height: 30px;"/>
    <span
            style="font-size: 18px">旅游管理系统</span></a></div>
<div class="sl-sideleft">

    <label class="sidebar-label">导航栏</label>
    <div class="sl-sideleft-menu">
        <a href="#" class="sl-menu-link   active show-sub">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i>
                <span class="menu-item-label">旅游资源</span>
                <i class="menu-item-arrow fa fa-angle-down"></i>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
        <ul class="sl-menu-sub nav flex-column">
            <li class="nav-item"><a th:href="@{/manager/travelResources(type=${1})}"
                                    th:class="${type eq 1} ? 'nav-link active' : 'nav-link '">景点</a></li>
            <li class="nav-item"><a th:href="@{/manager/travelResources(type=${2})}"
                                    th:class="${type eq 2} ? 'nav-link active' : 'nav-link '">名胜古迹</a></li>
            <li class="nav-item"><a th:href="@{/manager/travelResources(type=${3})}"
                                    th:class="${type eq 3} ? 'nav-link active' : 'nav-link '">公园</a></li>
            <li class="nav-item"><a th:href="@{/manager/travelResources(type=${4})}"
                                    th:class="${type eq 4} ? 'nav-link active' : 'nav-link '">博物馆</a></li>
        </ul>

        <a href="#" class="sl-menu-link">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i>
                <span class="menu-item-label">服务设施</span>
                <i class="menu-item-arrow fa fa-angle-down"></i>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
        <ul class="sl-menu-sub nav flex-column">
            <li class="nav-item"><a th:href="@{/manager/service(type=${1})}"
                                    th:class="${type eq 1} ? 'nav-link active' : 'nav-link '">旅团</a></li>
            <li class="nav-item"><a th:href="@{/manager/service(type=${2})}"
                                    th:class="${type eq 2} ? 'nav-link active' : 'nav-link '">旅馆</a></li>
            <li class="nav-item"><a th:href="@{/manager/service(type=${3})}"
                                    th:class="${type eq 3} ? 'nav-link active' : 'nav-link '">车站</a></li>
            <li class="nav-item"><a th:href="@{/manager/service(type=${4})}"
                                    th:class="${type eq 4} ? 'nav-link active' : 'nav-link '">监督机构</a></li>
        </ul>

        <a href="#" class="sl-menu-link">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i>
                <span class="menu-item-label">购物信息</span>
                <i class="menu-item-arrow fa fa-angle-down"></i>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
        <ul class="sl-menu-sub nav flex-column">
            <li class="nav-item"><a th:href="@{/manager/shop(type=${1})}"
                                    th:class="${type eq 1} ? 'nav-link active' : 'nav-link '">商城</a></li>
            <li class="nav-item"><a th:href="@{/manager/shop(type=${2})}"
                                    th:class="${type eq 2} ? 'nav-link active' : 'nav-link '">超市</a></li>
            <li class="nav-item"><a th:href="@{/manager/shop(type=${3})}"
                                    th:class="${type eq 3} ? 'nav-link active' : 'nav-link '">名优特产</a></li>
        </ul>
        <a href="#" class="sl-menu-link">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-gear-outline tx-24"></i>
                <span class="menu-item-label">预定信息</span>
                <i class="menu-item-arrow fa fa-angle-down"></i>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
        <ul class="sl-menu-sub nav flex-column">
            <li class="nav-item"><a th:href="@{/manager/order(flag=${1})}"
                                    th:class="${type eq 1} ? 'nav-link active' : 'nav-link '">未查看</a></li>
            <li class="nav-item"><a th:href="@{/manager/order(flag=${2})}"
                                    th:class="${type eq 2} ? 'nav-link active' : 'nav-link '">所有预定</a></li>
        </ul>

    </div>

</div><!-- sl-sideleft -->
<!-- ########## END: LEFT PANEL ########## -->

<!-- ########## START: HEAD PANEL ########## -->
<div class="sl-header">
    <div class="sl-header-left">
        <div class="navicon-left hidden-md-down"><a id="btnLeftMenu" href=""><i class="icon ion-navicon-round"></i></a>
        </div>
        <div class="navicon-left hidden-lg-up"><a id="btnLeftMenuMobile" href=""><i class="icon ion-navicon-round"></i></a>
        </div>
    </div><!-- sl-header-left -->
    <div class="sl-header-right">
        <nav class="nav">
            <div class="dropdown">
                <a href="" class="nav-link nav-link-profile" data-toggle="dropdown">
                    <span class="logged-name">信息技术系 | 网络工程</span>
                    <img th:src="@{/admin/picture/mt_logo_wh.jpg}" class="wd-32 rounded-circle" alt=""/>
                </a>
                <div class="dropdown-menu dropdown-menu-header wd-200">
                    <ul class="list-unstyled user-profile-nav">
                        <li><a href=""><i class="icon ion-ios-person-outline"></i> Edit Profile</a></li>
                        <li><a href=""><i class="icon ion-ios-gear-outline"></i> Settings</a></li>
                        <li><a href=""><i class="icon ion-ios-download-outline"></i> Downloads</a></li>
                        <li><a href=""><i class="icon ion-ios-star-outline"></i> Favorites</a></li>
                        <li><a href=""><i class="icon ion-ios-folder-outline"></i> Collections</a></li>
                        <li><a th:href="@{/logout}"><i class="icon ion-power"></i> Sign Out</a></li>
                    </ul>
                </div><!-- dropdown-menu -->
            </div><!-- dropdown -->
        </nav>
        <div class="navicon-right">

        </div><!-- navicon-right -->
    </div><!-- sl-header-right -->
</div><!-- sl-header -->
<!-- ########## END: HEAD PANEL ########## -->

<!-- ########## START: RIGHT PANEL ########## -->

<!-- ########## END: RIGHT PANEL ########## -->

<!-- ########## START: MAIN PANEL ########## -->
<div class="sl-mainpanel">
    <nav class="breadcrumb sl-breadcrumb">
        <a class="breadcrumb-item" th:href="@{/activity/list}">旅游管理系统</a>
        <a class="breadcrumb-item" th:href="@{/user/List}">旅游资源</a>
        <span class="breadcrumb-item active">
            <span th:if="${type eq 1}">景点</span>
            <span th:if="${type eq 2}">名胜古迹</span>
            <span th:if="${type eq 3}">公园</span>
            <span th:if="${type eq 4}">博物馆</span>
        </span>
    </nav>

    <div class="sl-pagebody">

        <div class="card pd-20 pd-sm-40">
            <form th:action="@{/manager/travelResources}" method="get" onsubmit="return valiForm();">
                <div class="row">
                    <div class="col-lg-8 mg-b-10">
                        <div class="input-group">
                            <input type="text" class="form-control clo-sm-6 col-md-4" name="key"
                                   placeholder="按名称或者地址搜索..." th:value="${key}"/>
                            <input type="hidden" id="type" name="type" th:value="${type}"/>
                            <span class="input-group-btn mg-r-20">
                                <button class="btn bd bg-white tx-gray-600" type="submit"><i class="fa fa-search"></i>
                                </button>
                            </span>
                            <a class="btn btn-info active btn-block col-lg-3" th:href="@{/manager/addSource}">新增旅游资源</a>
                        </div>

                    </div>
                </div>
            </form>
            <text th:if="${pageInfo.pages eq 0}" th:text="查无此记录"></text>
            <div th:if="${pageInfo.pages gt 0}">
                <div class="table-responsive">
                    <table class="table table-hover table-bordered mg-b-0">
                        <thead class="bg-info">
                        <tr>
                            <th class="wd-10p" style="text-align: center">名称</th>
                            <th class="wd-10p" style="text-align: center">地理位置</th>
                            <th class="wd-10p" style="text-align: center">电话</th>
                            <th class="wd-10p" style="text-align: center">价格</th>
                            <th class="wd-10p" style="text-align: center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="page: ${pageInfo.list}">
                            <td style="text-align: center"><span th:text="${page.so_name}"></span></td>
                            <td style="text-align: center"><span th:text="${page.so_area}">6</span></td>
                            <td style="text-align: center"><a th:text="${page.so_phone}"></a></td>
                            <td style="text-align: center"><a th:text="${page.so_price}"></a></td>
                            <td style="text-align: center"><a
                                    th:href="@{/manager/updateSource(so_id=${page.so_id})}">修改</a>|
                                <a th:href="@{/manager/delSource(so_id=${page.so_id})}" onclick="return del()">删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <!--页码 start-->

                    <div class="ht-80 bd d-flex align-items-center justify-content-center">
                        <nav aria-label="Page navigation">
                            <ul class="pagination pagination-basic mg-b-0">

                                <li th:class="${pageInfo.pageNum eq 1} ? 'page-item' : 'page-item'">
                                    <a class="page-link" aria-label="First" th:if="${pageInfo.pageNum eq 1}" href="#">
                                        <i class="fa fa-angle-double-left"></i>
                                    </a>
                                    <a class="page-link" aria-label="First"
                                       th:if="${pageInfo.pageNum ne 1} and ${pageInfo.pageNum &lt; 10}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPate=1)}">
                                        <i class="fa fa-angle-double-left"></i>
                                    </a>
                                    <a class="page-link" aria-label="First" th:if="${pageInfo.pageNum &gt; 10}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${pageInfo.pageNum - 10})}">
                                        <i class="fa fa-angle-double-left"></i>
                                    </a>
                                </li>

                                <li th:class="${pageInfo.pageNum eq 1} ? 'page-item' : 'page-item'">
                                    <a class="page-link" aria-label="previous" th:if="${pageInfo.pageNum eq 1}"
                                       href="#">
                                        <i class="fa fa-angle-left"></i>
                                    </a>
                                    <a class="page-link" aria-label="previous" th:if="${pageInfo.pageNum gt 1}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${pageInfo.pageNum - 1})}">
                                        <i class="fa fa-angle-left"></i>
                                    </a>
                                </li>

                                <li th:if="${pageInfo.pages eq 0}" class="page-item active"><a class="page-link"
                                                                                               href="#">1</a></li>
                                <li th:if="${pageInfo.pages ne 0}" th:each="currentPage : ${pageInfo.navigatepageNums}"
                                    th:class="${currentPage eq pageInfo.pageNum} ? 'page-item active' : 'page-item'">
                                    <a th:if="${pageInfo.pageNum eq currentPage}" class="page-link" href="#"
                                       th:text="${currentPage}">1</a>
                                    <a th:if="${pageInfo.pageNum ne currentPage} and ${currentPage ne 0}"
                                       class="page-link"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${currentPage})}"
                                       th:text="${currentPage}">1</a>
                                </li>

                                <li class="page-item">
                                    <a class="page-link" aria-label="Next" th:if="${pageInfo.pageNum eq pageInfo.pages}"
                                       href="#">
                                        <i class="fa fa-angle-right"></i>
                                    </a>
                                    <a class="page-link" aria-label="Next" th:if="${pageInfo.pages eq 0}" href="#">
                                        <i class="fa fa-angle-right"></i>
                                    </a>
                                    <a class="page-link" aria-label="Next" th:if="${pageInfo.pageNum lt pageInfo.pages}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${pageInfo.pageNum} + 1)}">
                                        <i class="fa fa-angle-right"></i>
                                    </a>
                                </li>

                                <li class="page-item">
                                    <a class="page-link" aria-label="Last" th:if="${pageInfo.pageNum eq pageInfo.pages}"
                                       href="#">
                                        <i class="fa fa-angle-double-right"></i>
                                    </a>
                                    <a class="page-link" aria-label="Last"
                                       th:if="${pageInfo.pageNum ne pageInfo.pages} and ${1 ge (pageInfo.pageNum+10)}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${pageInfo.pageNum} + 10)}">
                                        <i class="fa fa-angle-double-right"></i>
                                    </a>
                                    <a class="page-link" aria-label="Last"
                                       th:if="${pageInfo.pageNum ne pageInfo.pages} and ${1 lt (pageInfo.pageNum+10)}"
                                       th:href="@{/manager/travelResources(type=${type},key=${key},currentPage=${pageInfo.pages})}">
                                        <i class="fa fa-angle-double-right"></i>
                                    </a>
                                </li>

                            </ul>
                        </nav>
                    </div>
                </div>
                <!--页码 end-->
            </div><!-- table-responsive -->
        </div><!-- card -->
    </div><!-- sl-pagebody -->

    <footer class="sl-footer">
        <div class="footer-left">
            <div class="mg-b-2">Copyright &copy; 2018. 中原工学院信息商务学院. All Rights Reserved.</div>
        </div>
        <div class="footer-right d-flex align-items-center">Made by 信息技术系.</div>
    </footer>
</div><!-- sl-mainpanel -->
<!-- ########## END: MAIN PANEL ########## -->

<script th:src="@{/admin/js/jquery.js}"></script>
<script th:src="@{/admin/js/popper.js}"></script>
<script th:src="@{/admin/js/bootstrap.js}"></script>
<script th:src="@{/admin/js/perfect-scrollbar.jquery.js}"></script>
<script th:src="@{/admin/js/highlight.pack.js}"></script>
<script th:src="@{/admin/js/jquery.datatables.js}"></script>
<script th:src="@{/admin/js/datatables.responsive.js}"></script>
<script th:src="@{/admin/js/select2.min.js}"></script>

<script th:src="@{/admin/js/starlight.js}"></script>
<script>
    $(function () {
        'use strict';

        $('#datatable1').DataTable({
            responsive: true,
            bLengthChange: false,
            language: {
                searchPlaceholder: '输入关键字搜索...',
                sSearch: '',
            }
        });

        // Select2
        $('.dataTables_length select').select2({minimumResultsForSearch: Infinity});

    });

    function del() {
        if (confirm("您确定要删除吗？")) {
            return true;
        } else {
            return false;
        }
    }
</script>

</body>
</html>
